<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodeMirror</title>
<script type="text/javascript" src="../../s/codemirror/5.28.0/lib/codemirror.js"></script>
<link rel="stylesheet" href="../../s/codemirror/5.28.0/lib/codemirror.css">
<script type="text/javascript" src="../../s/codemirror/5.28.0/mode/javascript/javascript.js"></script>
<style type="text/css">
.CodeMirror {
	border: 1px solid #ddd;
	font-size: 13px
}

.CodeMirror pre {
	font-family: 'Microsoft Yahei', "Helvetica Neue", Helvetica, Verdana, "PingFang SC", Arial, sans-serif;
}
</style>
</head>
<body>
	<textarea id="myTextarea">console.log('hello code-mirror');</textarea>
	<!-- Create a simple CodeMirror instance -->
	<script>
		var editor = CodeMirror.fromTextArea(document.getElementById('myTextarea'), {
			lineNumbers : true,
			mode : 'text/typescript'
		});
		editor.setSize('auto', '300px');
	</script>
</body>
</html>